import java.util.List;
import java.util.ArrayList;
public class ConcreteIterator implements Iterator{
    private List<Object> collection;
    private int position = 0;

    public ConcreteIterator(List<Object> collection) {
        this.collection = collection;
    }

    @Override
    public boolean hasNext() {
        return position < collection.size();
    };


    @Override
    public Object next() {
        if (this.hasNext()) {
            return collection.get(position++);
        }
        return null;
    }
}
